import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError, map, tap } from 'rxjs/operators';

@Injectable({
  providedIn: 'root'
})
export class LoginService {

  constructor(private http: HttpClient) {}

  private baseUrl = 'https://api.sheencity.com/token';

  httpOptions = {
    headers: new HttpHeaders({
      'Content-Type': 'application/json',
      'x-ca-stage': 'test'
    }),
    passThruUnknownUrl: true,
  };

  doLogin(body): Observable<any> {
    return this.http.post<any>(this.baseUrl, {}, this.httpOptions).pipe(
      tap((v) => console.log('v is', v)),
    );
  }

}
